package interview.lingxing;

import java.util.Arrays;
import java.util.Scanner;


public class Test1 {
    public static void main(String[] args) {
        System.out.println(reverseString("123457"));
    }

    /**
     * 返回翻转后的字符串
     *
     * @param str
     * @return 返回翻转后的字符串
     */
    public static String reverseString(String str) {
        if (str == null || str.isEmpty()) {
            return str;
        }
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = str.length() - 1; i >= 0; i--) {
            stringBuilder.append(str.charAt(i));
        }
        return stringBuilder.toString();
    }
}
